package com.finalterm.product.dto;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 库存扣减DTO
 */
@Data
public class StockDeductDTO {
    
    @NotNull(message = "商品ID不能为空")
    private Long productId;
    
    @NotNull(message = "扣减数量不能为空")
    @Min(value = 1, message = "扣减数量必须大于0")
    private Integer quantity;
    
    /**
     * 订单ID，用于幂等性控制
     */
    private String orderId;
}
